package com.blb.mapper;

import com.blb.entity.Product;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blb.entity.Sort;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author wss
 * @since 2020-05-22
 */
public interface ProductMapper extends BaseMapper<Product> {
    /**
     * 增加
     *
     * @param product
     * @return
     */
    int addProduct(Product product);

    /**
     * 全查询
     *
     * @return
     */
    List<Product> getProductList(@Param("start")Integer start, @Param("length")Integer length, @Param("productName")String productName, @Param("status")Integer status,String companyId);

    int getProductCount(@Param("productName")String productName, @Param("status")Integer status,String companyId);

    /**
     * 单查询
     *
     * @param id
     * @return
     */
    Product productById(String id,String companyId);

    /**
     * 商品和分类连表查询单个
     * @param id
     * @return
     */
    Product productByIds(String id,String companyId);

    /**
     * 条件查询
     *
     * @param productName
     * @param productType
     * @return
     */
    Product productByNameOrType(String productName, String productType,String companyId);

    List<Sort> getSort(String companyId);

    List<Sort> getSorts(String sortId,String companyId);

    List<Sort> getSortss(String sortId,String companyId);

    int productStates1(String id,String companyId);

    int productStates2(String id,String companyId);

    int examineStates1(String id,String companyId);

    int examineStates2(String id,String companyId);

    int states1(String companyId);

    int states2(String companyId);

    int states3(String companyId);

    int productByIdss(String id);
}
